package com.dongdongshop.service.impl;

import com.dongdongshop.mapper.TbSpecificationOptionMapper;
import com.dongdongshop.pojo.TbSpecificationOption;
import com.dongdongshop.pojo.TbSpecificationOptionExample;
import com.dongdongshop.service.SpecificationOptionService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@DubboService
public class SpecificationOptionServiceImpl implements SpecificationOptionService {

    @Resource
    private TbSpecificationOptionMapper specificationOptionMapper;

    @Override
    public List<TbSpecificationOption> getSpecId(Long id) {
        return specificationOptionMapper.getSpecId(id);
    }

    @Override
    public List<TbSpecificationOption> selectOptionBySpecId(Long id) {
        TbSpecificationOptionExample example = new TbSpecificationOptionExample();
        TbSpecificationOptionExample.Criteria criteria = example.createCriteria();
        criteria.andSpecIdEqualTo(id);
        return specificationOptionMapper.selectByExample(example);
    }
}
